# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=glade
pkgver=3.38.2
pkgrel=4
pkgdesc="User Interface Designer for GTK+ and GNOME"
url="https://glade.gnome.org/"
arch="all"
license="GPL-2.0-or-later"
makedepends="gtk+3.0-dev libxml2-dev itstool gtk-doc intltool
	py3-gobject3-dev gobject-introspection-dev meson
	python3-dev webkit2gtk-dev"

case "$CARCH" in
	s390x|riscv64) ;;
	*) makedepends="$makedepends gjs-dev" ;;
esac

checkdepends="xvfb-run ibus adwaita-icon-theme"
options="!check" # If adwaita-icon-theme wasn't installed e before we'd have to updathe the icon cache
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://download.gnome.org/sources/glade/${pkgver%.*}/glade-$pkgver.tar.xz
	meson-0.60.patch
	duplicate-linguas.patch
	"


build() {
	abuild-meson \
		-Dgladeui=true \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	xvfb-run meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

dev() {
	default_dev
	mkdir -p "$pkgdir"/usr/share/glade
	mv "$subpkgdir"/usr/share/glade/catalogs "$pkgdir"/usr/share/glade
	mv "$subpkgdir"/usr/lib/glade "$pkgdir"/usr/lib/glade
}

sha512sums="
2df8c8363206905663cd3ac9196da44445425a888b64f1b3b3ac6cd41e14c4a82a5d2c299730ef0606c3970a04dd8f245bb5639218794eb67dcbd26fae17565e  glade-3.38.2.tar.xz
c529aff136bcdbdc2158cfe14589691f8b1731fc6ea77acdc0de58dc1315399ea85771332a00f9f72c73e5b8b17fa4c5d7dbf0753269b2d2c2ef46a0d69a9a95  meson-0.60.patch
791de7129df8cddcb470c6f8e70d3321d7f8053b47930aeadd5feded0b9c02ff2146a4028d1def062718fc60861da16f68e37e5b8dc67defc91ffdbe4d826eda  duplicate-linguas.patch
"
